﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VB;

namespace haunstm_test_windows_forms
{
    public partial class frmUpdateControlsAsync : Form
    {
        private VB.EventProvider _eventProvider;

        public frmUpdateControlsAsync()
        {
            InitializeComponent();
            _eventProvider = new EventProvider();

            _eventProvider.ColorEvent += eventProvide_ColorEvent;
        }

        private void frmUpdateControlsAsync_Load(object sender, EventArgs e)
        {

        }

        private void eventProvide_ColorEvent(object sender, EventProviderEventArgs e)
        {
            lblColorBox.BackColor = e.SetColor;
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            tmrPulse.Start();
        }

        private void tmrPulse_Tick(object sender, EventArgs e)
        {
            _eventProvider.Start();
        }
    }
}
